package com.link510.aitools.core.domain.message;


import com.link510.aitools.core.helper.UnixTimeHelper;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author cqnews
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TcpMessageInfo implements Serializable {

    private static final long serialVersionUID = 5104624004500850647L;


    /**
     * 消息Id
     */
    private Integer msgId = 0;

    /**
     * 消息分类
     */
    private String action = "";


    /**
     * 消息状态 -1为常态，0为成功，正常值为错误码
     */
    private int state = -1;

    /**
     * 消息说明
     */
    private String message = "";


    /**
     * 消息正文
     */
    private Object content;

    /**
     * 时间戳
     */
    private Integer timestamp = UnixTimeHelper.getInstance().getUnixTimeStamp();


    public TcpMessageInfo(String message) {
        this.message = message;
    }


    public TcpMessageInfo(String action, int state, String message) {
        this.action = action;
        this.state = state;
        this.message = message;
    }


}
